package com.csx.governance.traffic.adm.service.impl;

import com.csx.governance.traffic.adm.model.bo.SwimLaneDefinitionBO;
import com.csx.governance.traffic.adm.model.bo.SwimLaneRouteRuleBO;
import com.csx.governance.traffic.adm.model.dto.ImportResultDTO;
import com.csx.governance.traffic.adm.model.dto.SwimLaneDefinitionDTO;
import com.csx.governance.traffic.adm.model.dto.SwimLaneRouteRuleDTO;
import com.csx.governance.traffic.adm.model.dto.SwimLaneRouteRuleTypeDTO;
import com.csx.governance.traffic.adm.model.pojo.SwimLaneRuleTypeEnum;
import com.csx.governance.traffic.adm.service.SwimLaneRouteService;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

/**
 * @author cuisongxu
 * @date 2023/4/23 17:33
 */
@Service
public class SwimLaneRouteServiceImpl implements SwimLaneRouteService {

    @Override
    public List<SwimLaneRouteRuleDTO> getSwimLaneRouteRules(String serviceName, Integer pageNum, Integer pageSize) {
        return null;
    }

    @Override
    public void addSwimLaneRouteRule(SwimLaneRouteRuleBO swimLaneRouteRuleBO) {

    }

    @Override
    public void updateSwimLaneRouteRule(SwimLaneRouteRuleBO swimLaneRouteRuleBO) {

    }

    @Override
    public void deleteSwimLaneRouteRules(List<String> serviceNames) {

    }

    @Override
    public void exportSwimLaneRouteRules(List<String> serviceNames, HttpServletResponse response) {

    }

    @Override
    public ImportResultDTO<ImportResultDTO.SwimLaneRouteRuleKDTO> importSwimLaneRouteRules(String content, Integer repeatStrategyCode) {
        return null;
    }

    @Override
    public List<SwimLaneDefinitionDTO> getSwimLaneDefinitions(String swimLaneId, Integer pageNum, Integer pageSize) {
        return null;
    }

    @Override
    public void addSwimLaneDefinition(SwimLaneDefinitionBO swimLaneDefinitionBO) {

    }

    @Override
    public void updateSwimLaneDefinition(SwimLaneDefinitionBO swimLaneDefinitionBO) {

    }

    @Override
    public void deleteSwimLaneDefinitions(List<String> swimLaneIds) {

    }

    @Override
    public List<SwimLaneRouteRuleTypeDTO> getSwimLaneRouteRuleTypes() {

        List<SwimLaneRouteRuleTypeDTO> res = new ArrayList<>();

        for (SwimLaneRuleTypeEnum swimLaneRuleTypeEnum : SwimLaneRuleTypeEnum.values()) {

            String name = swimLaneRuleTypeEnum.name();
            String showName = swimLaneRuleTypeEnum.getName();
            String desc = swimLaneRuleTypeEnum.getDesc();

            SwimLaneRouteRuleTypeDTO swimLaneRouteRuleTypeDTO = new SwimLaneRouteRuleTypeDTO();
            swimLaneRouteRuleTypeDTO.setName(name);
            swimLaneRouteRuleTypeDTO.setShowName(showName);
            swimLaneRouteRuleTypeDTO.setDesc(desc);

            res.add(swimLaneRouteRuleTypeDTO);
        }

        return res;
    }
}
